package servlet.servlet_yaobo;

import service.impl.ImpShoppingMemberService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 删除选择的数据
 */
@WebServlet(value = "/deleall")
public class DeleteAllServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ImpShoppingMemberService imp=new ImpShoppingMemberService();
        String ids=req.getParameter("ids");
        String[] index=ids.split(",");
        for(String in:index){
            imp.deletes(Integer.parseInt(in));
        }
        req.getRequestDispatcher("Mem.jsp").forward(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
}
